home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / lblcs.arc / CRT_PREA.ASM < prev    next >
Assembly Source File  |  1985-04-05  |  1KB  |  70 lines

  1.  
  2. ;-------------------------------------------------------------------
  3. ;
  4. ; name        crt_pread - return color of pixel on graphics screen 
  5. ;
  6. ; synopsis    int color;
  7. ;        color = crt_pread(row, col);
  8. ;        int  row, col;
  9. ;
  10. ; description    This routine reads the color of the pixel on
  11. ;        a graphics screen.  It uses the BIOS "read-a-
  12. ;        points-color" routine, so it functions on any
  13. ;        type of monitor and under all graphics modes.
  14. ;
  15. ; notes        I  have no idea what happens if you attempt to call
  16. ;        the BIOS routine with crazy row and column values.
  17. ;
  18. ;-------------------------------------------------------------------
  19.  
  20.  
  21.     include    dos.mac
  22.  
  23. video    equ    10h        ; video interrupt number
  24.  
  25.  
  26.     IF    LPROG
  27. X    EQU    6        ;OFFSET OF ARGUMENTS
  28.     ELSE
  29. X    EQU    4        ;OFFSET OF ARGUMENTS
  30.     ENDIF
  31.  
  32.     PSEG
  33.  
  34.  
  35.     PUBLIC    crt_pread
  36.  
  37.  
  38.     IF    LPROG
  39. crt_pread    PROC    FAR
  40.     ELSE
  41. crt_pread    PROC    NEAR
  42.     ENDIF
  43.  
  44.  
  45. ROW     EQU     [BP+x]
  46. COL     EQU     [BP+x+2]
  47.  
  48.  
  49.     push    bp
  50.     mov    bp,sp
  51.  
  52.         mov     AH,13
  53.         mov     CX,COL
  54.         mov     DX,ROW
  55.         int     video
  56.         xor     AH,AH
  57.  
  58.     pop    bp
  59.     ret
  60.  
  61.  
  62. crt_pread    ENDP
  63.  
  64.  
  65.     endps
  66.     end
  67.  
  68.  
  69.  
  70.